<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--监控系统编辑页面-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>监控系统</title>
<link href="css/style2.css" rel="stylesheet" type="text/css" />

<!--JS上传文件-->
<script type="text/javascript">

        function previewFile() {
            // var preview = document.querySelector('img');
            var preview = document.getElementById('view_image');
            var file = document.querySelector('input[type=file]').files[0];
            var reader = new FileReader();

            reader.onloadend = function () {
                preview.src = reader.result;
            }

            if (file) {
                reader.readAsDataURL(file);
            } else {
                preview.src = "";
            }
        }

    </script>


</head>

<body>

	<div class="formbody">

		<div class="formtitle">
			<span>监控系统</span>
		</div>
		<form action="AHerfs_addSurveillanceSystem" method="post"
			enctype="multipart/form-data">
			<ul class="forminfo">
				<li><label>名称：</label><input name="title" type="text"
					class="dfinput" /><i>标题不能超过10个字符</i></li>
				<li><label>链接地址：</label><input name="aherf" type="text"
					class="dfinput" /><i>该图片的链接地址</i></li>

				<li><label>选择图片：</label> <img id="view_image"
					src="images/c03.png" height="200" alt="Image preview..."> <br>
					<label>&nbsp;</label><input class="selectfile" type="file"
					onchange="previewFile()" name="file" /><br /></li>


				<ul style="float: left; display: inline">

					<li style="display: inline"><a
						href="" target="rightFrame" /> <input
						name="" type="submit" class="btn" value="确认" /></li>
				</ul>
			</ul>
		</form>
	</div>
</body>
</html>
